<?php

namespace app\api\validate;
use think\Validate;

class Supplier extends Validate{
    protected $rule = [
        'mobile'=>'require|regex:/1[34578]{1}\d{9}$/',
        'code'  =>'require', // 手机验证码
        'name'  =>'require', //场地商名称|活动商名称|主讲老师名称
        'person'=>'require',// 负责人姓名
        'city' =>'require', // 所在城市
        'address'    =>'require', // 具体地址
        'sitetype' =>'require', // 场地承接类型
        'type'  => 'require',
        'is_ticket' => 'require',
        'truename' =>'require',
        'office' =>'require',
        'company_post' =>'require',

    ];

    protected $message = [
        'mobile.require'        =>  1000,
        'mobile.regex'          =>  1001,
        'code.require'          =>  1002,
        'name.require'          =>  30000,
        'person.require'        =>  30001,
        'city.require'          =>  30002,
        'address.require'       =>  30003,
        'sitetype.require'      =>  30004,
        'type.require'          =>  30005,
        'is_ticket.require'     =>  30006,
        'office'                =>  30007,
        'company_post'          =>  30008,

    ];

    protected $scene = [
        'sms' => ['mobile'],
        'validate' => ['mobile','code'],
        'site_reg'     =>  ['type','mobile','name','person','city','address','sitetype'],// 场地商注册
        'activity_reg' =>  ['type','mobile','name','person','city','address','is_ticket','sitetype'],// 活动商注册
        'master_reg'   =>  ['type','mobile','name','city','office','company_post'],// 主讲老师注册
        /*'edit'  =>  ['username','showpwd'],// 编辑客户
        'login' =>  ['username','password'],
        'add_staff'   =>  ['username','password','type','task_list'],
        'edit_staff'  =>  ['username','showpwd','type','task_list'],*/
    ];
}